home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 October / Macformat17.cdr / Shareware City / Education / RLaB / rlib / union.r < prev    next >
Encoding:
Text File  |  1994-06-18  |  448 b   |  19 lines  |  [TEXT/ttxt]

  1. //-------------------------------------------------------------------//
  2. //  union
  3.  
  4. //  Syntax:    union ( A , B )
  5.  
  6. //  Description:
  7.  
  8. //  The union function returns a vector set that is the union of the
  9. //  two sets A, and B.
  10.  
  11. //  See Also: complement, intersection, set
  12. //-------------------------------------------------------------------//
  13.  
  14. union = function ( A, B )
  15. {
  16.   if (A.n == 0 && B.n == 0) { return []; }
  17.   return set ( [ A[:] ; B[:] ] ) 
  18. };
  19.